﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xts
{
    namespace XInterBank
    {
        namespace TradingClient
        {
            [Serializable]
            public class XBondOrderInfoQueryRspEventArgs : EventArgs
            {
                private XBondOrderInfoQueryRsp x_rsp;
                private XTradingQuery_QueryOrderInfo_Cookies x_cookies;
                public XBondOrderInfoQueryRsp Rsp
                {
                    get { return x_rsp; }
                    set { x_rsp = value; }
                }

                public XTradingQuery_QueryOrderInfo_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBondOrderInfoQueryRspEventArgs(XBondOrderInfoQueryRsp rsp, XTradingQuery_QueryOrderInfo_Cookies cookies)
                {
                    x_rsp = rsp;
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XBondOrderInfoQueryCookiesEventArgs : EventArgs
            {
                private XTradingQuery_QueryOrderInfo_Cookies x_cookies;
                public XTradingQuery_QueryOrderInfo_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }
                public XBondOrderInfoQueryCookiesEventArgs(XTradingQuery_QueryOrderInfo_Cookies cookies)
                {
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XBatchBondOrderInfoQueryRspEventArgs : EventArgs
            {
                private XBondOrderInfoQueryRsp x_rsp;
                private XTradingQuery_BatchQueryOrderInfo_Cookies x_cookies;
                public XBondOrderInfoQueryRsp Rsp
                {
                    get { return x_rsp; }
                    set { x_rsp = value; }
                }
                public XTradingQuery_BatchQueryOrderInfo_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBatchBondOrderInfoQueryRspEventArgs(XBondOrderInfoQueryRsp rsp, XTradingQuery_BatchQueryOrderInfo_Cookies cookies)
                {
                    x_rsp = rsp;
                    x_cookies = cookies;
                }

            }

            [Serializable]
            public class XBatchBondOrderInfoQueryCookiesEventArgs : EventArgs
            {
                private XTradingQuery_BatchQueryOrderInfo_Cookies x_cookies;

                public XTradingQuery_BatchQueryOrderInfo_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBatchBondOrderInfoQueryCookiesEventArgs(XTradingQuery_BatchQueryOrderInfo_Cookies cookies)
                {
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XBondOrderFillQueryRspEventArgs : EventArgs
            {
                private XBondOrderFillQueryRsp x_rsp;
                private XTradingQuery_QueryOrderFill_Cookies x_cookies;
                public XBondOrderFillQueryRsp Rsp
                {
                    get { return x_rsp; }
                    set { x_rsp = value; }
                }
                public XTradingQuery_QueryOrderFill_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBondOrderFillQueryRspEventArgs(XBondOrderFillQueryRsp rsp, XTradingQuery_QueryOrderFill_Cookies cookies)
                {
                    x_rsp = rsp;
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XBondOrderFillQueryCookiesEventArgs : EventArgs
            {
                private XTradingQuery_QueryOrderFill_Cookies x_cookies;
                public XTradingQuery_QueryOrderFill_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBondOrderFillQueryCookiesEventArgs(XTradingQuery_QueryOrderFill_Cookies cookies)
                {
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XBatchBondOrderFillQueryRspEventArgs : EventArgs
            {
                private XBondOrderFillQueryRsp x_rsp;
                private XTradingQuery_BatchQueryOrderFill_Cookies x_cookies;
                public XBondOrderFillQueryRsp Rsp
                {
                    get { return x_rsp; }
                    set { x_rsp = value; }
                }

                public XTradingQuery_BatchQueryOrderFill_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBatchBondOrderFillQueryRspEventArgs(XBondOrderFillQueryRsp rsp, XTradingQuery_BatchQueryOrderFill_Cookies cookies)
                {
                    x_rsp = rsp;
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XBatchBondOrderFillQueryCookiesEventArgs : EventArgs
            {
                private XTradingQuery_BatchQueryOrderFill_Cookies x_cookies;
                public XTradingQuery_BatchQueryOrderFill_Cookies Cookies
                {
                    get { return x_cookies; }
                    set { x_cookies = value; }
                }

                public XBatchBondOrderFillQueryCookiesEventArgs(XTradingQuery_BatchQueryOrderFill_Cookies cookies)
                {
                    x_cookies = cookies;
                }
            }

            [Serializable]
            public class XAmiTradingQueryCallbackEventHandler : IXAmiTradingQueryCBHandler
            {
                public EventHandler<XBondOrderInfoQueryRspEventArgs> QueryOrderInfoRspReached;
                public EventHandler<XBondOrderInfoQueryCookiesEventArgs> FailureQueryOrderInfoReached;
                public EventHandler<XBatchBondOrderInfoQueryRspEventArgs> BatchQueryOrderInfoRspReached;
                public EventHandler<XBatchBondOrderInfoQueryCookiesEventArgs> FailureBatchQueryOrderInfoReached;
                public EventHandler<XBondOrderFillQueryRspEventArgs> QueryOrderFillRspReached;
                public EventHandler<XBondOrderFillQueryCookiesEventArgs> FailureQueryOrderFillReached;
                public EventHandler<XBatchBondOrderFillQueryRspEventArgs> BatchQueryOrderFillRspReached;
                public EventHandler<XBatchBondOrderFillQueryCookiesEventArgs> FailureBatchQueryOrderFillReached;

                public XAmiTradingQueryCallbackEventHandler() { }
                
                public void OnQueryOrderInfo(XBondOrderInfoQueryRsp rsp, XTradingQuery_QueryOrderInfo_Cookies cookies) 
                {
                    EventHandler<XBondOrderInfoQueryRspEventArgs> handler = QueryOrderInfoRspReached;
                    if(handler != null)
                    {
                        handler(this, new XBondOrderInfoQueryRspEventArgs(rsp, cookies));
                    }
                }
                public void OnFailureQueryOrderInfo(XTradingQuery_QueryOrderInfo_Cookies cookies) 
                {
                    EventHandler<XBondOrderInfoQueryCookiesEventArgs> handler = FailureQueryOrderInfoReached;
                    if(handler != null)
                    {
                        handler(this, new XBondOrderInfoQueryCookiesEventArgs(cookies));
                    }
                }
                public void OnBatchQueryOrderInfo(XBondOrderInfoQueryRsp rsp, XTradingQuery_BatchQueryOrderInfo_Cookies cookies) 
                {
                    EventHandler<XBatchBondOrderInfoQueryRspEventArgs> handler = BatchQueryOrderInfoRspReached;
                    if(handler != null)
                    {
                        handler(this, new XBatchBondOrderInfoQueryRspEventArgs(rsp, cookies));
                    }
                }
                public void OnFailureBatchQueryOrderInfo(XTradingQuery_BatchQueryOrderInfo_Cookies cookies) 
                {
                    EventHandler<XBatchBondOrderInfoQueryCookiesEventArgs> handler = FailureBatchQueryOrderInfoReached;
                    if(handler != null)
                    {
                        handler(this, new XBatchBondOrderInfoQueryCookiesEventArgs(cookies));
                    }
                }
                public void OnQueryOrderFill(XBondOrderFillQueryRsp rsp, XTradingQuery_QueryOrderFill_Cookies cookies) 
                {
                    EventHandler<XBondOrderFillQueryRspEventArgs> handler = QueryOrderFillRspReached;
                    if(handler != null)
                    {
                        handler(this, new XBondOrderFillQueryRspEventArgs(rsp, cookies));
                    }
                }
                public void OnFailureQueryOrderFill(XTradingQuery_QueryOrderFill_Cookies cookies) 
                {
                    EventHandler<XBondOrderFillQueryCookiesEventArgs> handler = FailureQueryOrderFillReached;
                    if(handler != null)
                    {
                        handler(this, new XBondOrderFillQueryCookiesEventArgs(cookies));
                    }
                }
                public void OnBatchQueryOrderFill(XBondOrderFillQueryRsp rsp, XTradingQuery_BatchQueryOrderFill_Cookies cookies) 
                {
                    EventHandler<XBatchBondOrderFillQueryRspEventArgs> handler = BatchQueryOrderFillRspReached;
                    if(handler != null)
                    {
                        handler(this, new XBatchBondOrderFillQueryRspEventArgs(rsp, cookies));
                    }
                }
                public void OnFailureBatchQueryOrderFill(XTradingQuery_BatchQueryOrderFill_Cookies cookies) 
                {
                    EventHandler<XBatchBondOrderFillQueryCookiesEventArgs> handler = FailureBatchQueryOrderFillReached;
                    if(handler != null)
                    {
                        handler(this, new XBatchBondOrderFillQueryCookiesEventArgs(cookies));
                    }
                }
            }
        }
    }
}


